Optimal. Leaf size=103 \[ \frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {3 a b^2 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {3 a^2 b \sec (c+d x)}{d}-\frac {b^3 \sec (c+d x)}{d}+\frac {b^3 \sec ^3(c+d x)}{3 d}+\frac {3 a b^2 \sec (c+d x) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3169, 3855,
2686, 8, 2691} \begin {gather*} \frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {3 a^2 b \sec (c+d x)}{d}-\frac {3 a b^2 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {3 a b^2 \tan (c+d x) \sec (c+d x)}{2 d}+\frac {b^3 \sec ^3(c+d x)}{3 d}-\frac {b^3 \sec (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2686
Rule 2691
Rule 3169
Rule 3855
Rubi steps
\begin {align*} \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx &=\int \left (a^3 \sec (c+d x)+3 a^2 b \sec (c+d x) \tan (c+d x)+3 a b^2 \sec (c+d x) \tan ^2(c+d x)+b^3 \sec (c+d x) \tan ^3(c+d x)\right ) \, dx\\ &=a^3 \int \sec (c+d x) \, dx+\left (3 a^2 b\right ) \int \sec (c+d x) \tan (c+d x) \, dx+\left (3 a b^2\right ) \int \sec (c+d x) \tan ^2(c+d x) \, dx+b^3 \int \sec (c+d x) \tan ^3(c+d x) \, dx\\ &=\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {3 a b^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{2} \left (3 a b^2\right ) \int \sec (c+d x) \, dx+\frac {\left (3 a^2 b\right ) \text {Subst}(\int 1 \, dx,x,\sec (c+d x))}{d}+\frac {b^3 \text {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\sec (c+d x)\right )}{d}\\ &=\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {3 a b^2 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {3 a^2 b \sec (c+d x)}{d}-\frac {b^3 \sec (c+d x)}{d}+\frac {b^3 \sec ^3(c+d x)}{3 d}+\frac {3 a b^2 \sec (c+d x) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(293\) vs. \(2(103)=206\).
time = 1.70, size = 293, normalized size = 2.84 \begin {gather*} \frac {36 a^2 b-10 b^3-6 a \left (2 a^2-3 b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 a^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-18 a b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {9 a b^2}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {b^3}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+2 b \left (18 a^2-b^2+2 b^2 \cos (c+d x)+\left (18 a^2-5 b^2\right ) \cos (2 (c+d x))\right ) \sec ^3(c+d x) \sin ^2\left (\frac {1}{2} (c+d x)\right )-\frac {9 a b^2}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {b^3}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.34, size = 146, normalized size = 1.42
method | result | size |
derivativedivides | \(\frac {a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+\frac {3 a^{2} b}{\cos \left (d x +c \right )}+3 a \,b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )}{d}\) | \(146\) |
default | \(\frac {a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+\frac {3 a^{2} b}{\cos \left (d x +c \right )}+3 a \,b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )}{d}\) | \(146\) |
risch | \(-\frac {b \left (9 i a b \,{\mathrm e}^{5 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-36 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+4 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-9 i a b \,{\mathrm e}^{i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {3 a \,b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {3 a \,b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) | \(219\) |
norman | \(\frac {\frac {\left (12 a^{2} b -8 b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {18 a^{2} b -4 b^{3}}{3 d}-\frac {\left (6 a^{2} b +4 b^{3}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {3 a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {9 a \,b^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {6 a \,b^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {6 a \,b^{2} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {9 a \,b^{2} \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {3 a \,b^{2} \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {6 a^{2} b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {6 a^{2} b \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 b \left (9 a^{2}-8 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-\frac {a \left (2 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a \left (2 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(350\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.33, size = 118, normalized size = 1.15 \begin {gather*} -\frac {9 \, a b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - \frac {36 \, a^{2} b}{\cos \left (d x + c\right )} + \frac {4 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} b^{3}}{\cos \left (d x + c\right )^{3}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.87, size = 123, normalized size = 1.19 \begin {gather*} \frac {3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 18 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 4 \, b^{3} + 12 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2}}{12 \, d \cos \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 171, normalized size = 1.66 \begin {gather*} \frac {3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 18 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 36 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 18 \, a^{2} b + 4 \, b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.38, size = 160, normalized size = 1.55 \begin {gather*} -\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (3\,a\,b^2-2\,a^3\right )}{d}-\frac {6\,a^2\,b-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (12\,a^2\,b-4\,b^3\right )-\frac {4\,b^3}{3}+3\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-3\,a\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________